<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/*----------------------------------------------------------------------------
<span class='line'>  2</span>  | Copyright (c) 2009 Matthew B. Brophy (matt@brophy.org).  
<span class='line'>  3</span>  | Liscense: MIT License (http://www.opensource.org/licenses/mit-license.php)
<span class='line'>  4</span>  |
<span class='line'>  5</span>  | $Id: D__matt_Computer_JavaScript_orgbrophyjs_trunk_org_brophy_js_select.js.html 30 2009-07-31 03:13:23Z matt@brophy.org $
<span class='line'>  6</span>  -----------------------------------------------------------------------------*/</span><span class="WHIT">
<span class='line'>  7</span> 
<span class='line'>  8</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">org</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>  9</span> </span><span class="WHIT">    </span><span class="NAME">org</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">org</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 10</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">org.brophy</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 11</span> </span><span class="WHIT">    </span><span class="NAME">org.brophy</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">org.brophy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 12</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">org.brophy.js</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 13</span> </span><span class="WHIT">    </span><span class="NAME">org.brophy.js</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">org.brophy.js</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/** 
<span class='line'> 16</span>  * @namespace 
<span class='line'> 17</span>  * @description Library of useful functions for dealing with SELECT elements
<span class='line'> 18</span>  *              in HTML pages.
<span class='line'> 19</span>  * @requires    This library requires the &lt;a href="http://www.mochikit.com">
<span class='line'> 20</span>  *              MochiKit&lt;/a> JavaScript library 
<span class='line'> 21</span>  *              (version 1.4+).
<span class='line'> 22</span>  */</span><span class="WHIT">
<span class='line'> 23</span> </span><span class="NAME">org.brophy.js.select</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 24</span> 
<span class='line'> 25</span> </span><span class="COMM">/**
<span class='line'> 26</span>  * @description  Selects the OPTION element with value 'val' in the SELECT 
<span class='line'> 27</span>  *               element 'sel'
<span class='line'> 28</span>  * @param        sel
<span class='line'> 29</span>  *               The SELECT element
<span class='line'> 30</span>  * @param        [val] 
<span class='line'> 31</span>  *               The value of the OPTION element to set as selected.  If no 
<span class='line'> 32</span>  *               value is passed, then the first item in the select box will 
<span class='line'> 33</span>  *               be selected
<span class='line'> 34</span>  * @return       TRUE if the value is found and the OPTIONselected, FALSE 
<span class='line'> 35</span>  *               otherwise
<span class='line'> 36</span>  * @type         boolean
<span class='line'> 37</span>  */</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="NAME">org.brophy.js.select.setSelectedIndexByValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT">        </span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel.options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT">    </span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">org.brophy.js.select.setSelectedIndex</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT">    </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">org.brophy.js.select.setSelectedIndex</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">               </span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT">               </span><span class="NAME">org.brophy.js.array.indexOf</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT">                 </span><span class="NAME">sel.options</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT">                 </span><span class="NAME">val</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT">                 </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">MochiKit.Base.compare</span><span class="PUNC">(</span><span class="NAME">a.value</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">    </span><span class="WHIT">
<span class='line'> 56</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 57</span> 
<span class='line'> 58</span> </span><span class="COMM">/**
<span class='line'> 59</span>  * @description  Selects the OPTION element with index 'index' in the SELECT 
<span class='line'> 60</span>  *               element 'sel'
<span class='line'> 61</span>  * @param        sel
<span class='line'> 62</span>  *               The SELECT element
<span class='line'> 63</span>  * @param        [index = 0] 
<span class='line'> 64</span>  *               The integer index of the OPTION element to select.  If no 
<span class='line'> 65</span>  *               index is passed, then the first item in the select box will be
<span class='line'> 66</span>  *               selected
<span class='line'> 67</span>  * @return       TRUE if the OPTION is present and selected, FALSE otherwise
<span class='line'> 68</span>  * @type         boolean
<span class='line'> 69</span>  */</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="NAME">org.brophy.js.select.setSelectedIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT">      </span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel.options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">index</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT">     </span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">sel.options.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">sel.options</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">selected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT">  </span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT">  </span><span class="NAME">sel.selectedIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sel.selectedIndex</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 84</span> 
<span class='line'> 85</span> </span><span class="COMM">/**
<span class='line'> 86</span>  * @description  Sorts the OPTIONS in the SELECT element 'sel' based on the 
<span class='line'> 87</span>  *               display value of the OPTION.  IF neccesary, the ignore_n 
<span class='line'> 88</span>  *               parameter can specify the number of options to ignore, in case
<span class='line'> 89</span>  *               there are default or information values first in the list.
<span class='line'> 90</span>  * @param        sel
<span class='line'> 91</span>  *               The SELECT element
<span class='line'> 92</span>  * @param        [ignore_n = 0] 
<span class='line'> 93</span>  *               The number of OPTION elements to ignore at the beginning of 
<span class='line'> 94</span>  *               the SELECT box.  If this is not passed, no elements will be 
<span class='line'> 95</span>  *               ignored.
<span class='line'> 96</span>  * @return       TRUE if the SELECT element is sorted, FALSE otherwise.
<span class='line'> 97</span>  * @type         boolean
<span class='line'> 98</span>  */</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="NAME">org.brophy.js.select.sortSelectOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ignore_n</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>100</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">org.brophy.js</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">localOpts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT">  </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NAME">sel.options.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">localOpts.push</span><span class="PUNC">(</span><span class="NAME">MochiKit.DOM.removeElement</span><span class="PUNC">(</span><span class="NAME">sel.options</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>106</span> 
<span class='line'>107</span> </span><span class="WHIT">  </span><span class="NAME">localOpts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.array.sortArrayOfObjects</span><span class="PUNC">(</span><span class="NAME">localOpts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ignore_n</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>108</span> 
<span class='line'>109</span> </span><span class="WHIT">  </span><span class="NAME">MochiKit.Iter.forEach</span><span class="PUNC">(</span><span class="NAME">localOpts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">opt</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT">      </span><span class="NAME">MochiKit.DOM.appendChildNodes</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> 
<span class='line'>114</span> </span><span class="WHIT">  </span><span class="NAME">org.brophy.js.select.setSelectedIndex</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>117</span> 
<span class='line'>118</span> </span><span class="COMM">/**
<span class='line'>119</span>  * @description  Function to gray out a select box when the first option 
<span class='line'>120</span>  *               is selected, under the assumption that this is a default, 
<span class='line'>121</span>  *               informational option.  Please note that in order for this 
<span class='line'>122</span>  *               to work correctly, the select must be given a CSS class of 
<span class='line'>123</span>  *               'obj_DefaultSelect'
<span class='line'>124</span>  * 
<span class='line'>125</span>  * @param        e
<span class='line'>126</span>  *               The event first from the &lt;select&gt; onchange event
<span class='line'>127</span>  */</span><span class="WHIT">
<span class='line'>128</span> </span><span class="NAME">org.brophy.js.select.setDefaultSelectStyle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>129</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT">  </span><span class="NAME">sel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">org.brophy.js.event.getElement</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">MochiKit.Base.isUndefinedOrNull</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">sel.selectedIndex</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">    </span><span class="NAME">MochiKit.DOM.addElementClass</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="STRN">"obj_gray"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">    </span><span class="NAME">MochiKit.DOM.removeElementClass</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="STRN">"obj_black"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT">  </span><span class="KEYW">else</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">    </span><span class="NAME">MochiKit.DOM.addElementClass</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="STRN">"obj_black"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">    </span><span class="NAME">MochiKit.DOM.removeElementClass</span><span class="PUNC">(</span><span class="NAME">sel</span><span class="PUNC">,</span><span class="STRN">"obj_gray"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>142</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>143</span> 
<span class='line'>144</span> </span></pre></body></html>